
//引入pinia
import { defineStore } from 'pinia'

//创建一个存储
export const useStore = defineStore('user', {
    state:()=>({
        "name":"zs",
        "age":20
    }),
    getters:{      //属性计算
        aa:(state) => state.name + "xxxx",
        bb:(state) => state.age
    },
    actions:{      //修改
        updateUsername(name){
            this.name = name;
        }
    }
})
